package com.tanhua.manager.job;

import com.tanhua.manager.service.AnalysisByDayService;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class AnalysisJob {

    @Autowired
    private AnalysisByDayService analysisByDayService;

//    @Scheduled(cron = "58 59 23 * * ?")
    @Scheduled(cron = "30 27 9 * * ?")
    public void analysisByDay(){
        String todayStr = new DateTime().toString("yyyy-MM-dd");
        analysisByDayService.analysisByDay(todayStr);
        System.out.println("完成了"+todayStr+"的统计");
    }

}
